<template>
  <div class="target_item" :ref="dropNode">
    <div class="item_stick" :style="`background-image: url(${props.url})`">
      <div class="box" :class="{ boxNav: props.text }">{{ props.text }}</div>
    </div>
  </div>
</template>
<script setup>
import { useDrop } from "vue3-dnd";
const props = defineProps({
  text: String,
  url: String,
  type: String,
  order: Number,
  onDrop: Function,
});
const [collect, dropNode] = useDrop(() => {
  const { type: accept, onDrop } = props || {};
  return {
    accept,
    drop: onDrop,
  };
});
</script>
<style lang="less" scoped>
.target_item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  .item_stick {
    position: relative;
    margin-bottom: 20px;
    width: 315px;
    height: 368px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    .box {
      position: absolute;
      left: 38px;
      bottom: 26px;
      width: 238px;
      height: 78px;
      line-height: 78px;
      border-radius: 12px;
      opacity: 1;
      /* 自动布局 */
      background: #fffde9;
      box-sizing: border-box;
      border: 2px solid #ff1100;
    }
    .boxNav {
      font-family: FZLanTingYuanS-R-GB;
      font-size: 2.083333vw;
      font-weight: normal;
      text-align: center;
      letter-spacing: 0.09em;
      font-variation-settings: "opsz" auto;
    }
  }
}
</style>
